package cn.tedu;

import cn.tedu.simple.utils.RabbitMQUtil;

import java.io.IOException;
import java.util.Scanner;

/**
 * @Author: Miyako
 * @Date: 2024-09-26-11:53
 * @Description:
 */
public class Producer {
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        RabbitMQUtil rabbitMQUtil = new RabbitMQUtil("admin", "Aq71056r");
        rabbitMQUtil.createWorkQueue(true,false,false,null);
        while (true) {
            System.out.println("输入你要发送的信息");
            String message = sc.nextLine();
            if (message.equals("exit")||message.equals("quit")) {
                rabbitMQUtil.closeConnection();
                break;
            }
            rabbitMQUtil.sendMessage(message);
        }
    }
}
